/*
 * @Author: your name
 * @Date: 2021-01-28 18:34:19
 * @LastEditTime: 2021-04-13 15:58:17
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \admin-element-djd:\downLoad\chrome-qrcode\main.js
 */
chrome.tabs.getSelected(null, function (tab) {
    // console.log('getSelected', tab)
    document.getElementById('title').innerHTML = tab.title
    document.getElementById('title').title = tab.title
    new QRCode('code', {
        text: tab.url,
        width: 180,
        height: 180,
        colorDark: '#000',
        colorLight: '#fff',
        correctLevel: QRCode.CorrectLevel.H
    })
    document.getElementById('copy-text').value = tab.url
    document.getElementById('btn').onclick = function () {
        let url = document.querySelector('#copy-text');
        url.select(); // 选择对象
        document.execCommand("Copy");
    }

})
